package DBLayer;

import static org.junit.Assert.*;

import org.junit.Test;
import java.util.ArrayList;
import ModelLayer.Employee;
import ModelLayer.Customer;

public class DBEmployeeTest {

//	@Test
//	public void testInsert() throws Exception
//    {
//		Employee emp = new Employee();
//
//		emp.setIdEmployee("nextIdEmployee");
//		emp.setName("Jack");
//		emp.setCpr("2508291232429");
//		emp.setHourlyWage(2500);
//		emp.setBankAccountNo("0005461235465");
//		emp.setAddress("vejen 5");
//		emp.setCity("Byen 2");
//		emp.setPhoneNo("4025588125");
//		emp.setEmail("anders@andersen.org");
//
//		DBEmployee dbEmp = new DBEmployee();
//		int i = dbEmp.insertEmployee(emp);
//
//		if(i == 1)
//		{
//			System.out.println("Works");
//		}
//		else
//			fail();
//	}

    @Test
	public void testUpdate() throws Exception
    {
		Employee emp = new Employee();
		DBEmployee dbEmp = new DBEmployee();
		emp = dbEmp.findEmployeeById("713");

		emp.setName("Dr Dre");

		int i = dbEmp.updateEmployee(emp);
	}

//    @Test
//	public void testDelete() throws Exception
//	{
//		Employee emp = new Employee();
//		DBEmployee dbEmp = new DBEmployee();
//		emp = dbEmp.findEmployeeById("714");
//
//		if(emp != null)
//		{
//			int i = dbEmp.deleteEmployee("714");
//
//		}
//		else
//			fail();
//	}

//    @Test
//	public void testGetAllEmployees() throws Exception
//	{
//		ArrayList<Employee> empList= new ArrayList<Employee>();
//		DBEmployee dbEmp = new DBEmployee();
//		empList = dbEmp.getAllEmployees();
//
//		if(empList != null)
//			for(Employee emp1 : empList)
//				System.out.println("idEmployee : " + emp1.getIdEmployee() + " Name : " + emp1.getName());
//		else
//			fail();
//
//	}
//
//    @Test
//	public ArrayList<Employee> getAllEmp()
//	{
//		ArrayList<Employee> empList= new ArrayList<Employee>();
//		DBEmployee dbEmp = new DBEmployee();
//		empList = dbEmp.getAllEmployees();
//
//		if(empList == null)
//			fail("Kunne ikke finde alle medarbejdere");
//
//		return empList;
//
//	}
//
//    @Test
//    public void testFindEmployeeByName()
//    {
//
//        DBEmployee dbEmp = new DBEmployee();
//        Employee emp = dbEmp.findEmployeeByName("Hans Børge Poulsen");
//
//        if (emp != null){
//            System.out.println("EmployeeName has been found");
//            System.out.println("Name : " + emp.getName() + ", idEmployee : " + emp.getIdEmployee());
//        }
//        else fail();
//    }
//
//    @Test
//    public void testFindEmployeeById()
//    {
//        DBEmployee dbEmp = new DBEmployee();
//        Employee emp = dbEmp.findEmployeeById("710");
//
//        if (emp != null){
//            System.out.println("EmployeeId has been found");
//            System.out.println("idEmployee : " + emp.getIdEmployee() + ", Name : " + emp.getName());
//        }
//        else fail();
//    }
}
